<template>
	<div class="home">
		<baseTable :columns="column"></baseTable>
	</div>
</template>

<script>
import { query } from '@/api/demo/index.js';
import baseTable from '@/components/base-table/index.vue';

export default {
	name: 'Home',

	data() {
		return {
			column: [
				{ type: 'checkBox' },
				{ type: 'index' },
				{ prop: 'name', label: '姓名', type: 'link' },
				{ prop: 'age', label: '年龄' },
				{
					type: 'propCode',
					prop: 'sex',
					label: '性别',
					codeName: [
						{ auth: 0, label: '女' },
						{ auth: 1, label: '男' },
						{ auth: 3, label: '应该是男的吧' },
					],
				},
				{
					label: '操作项',
					type: 'operation',
					operation: [
						{ auth: 'update', authText: '编辑' },
						{ auth: 'delete', authText: '删除' },
						{ auth: 'detail', authText: '查看' },
					],
				},
			],
		};
	},

	components: { baseTable },

	created() {
		query().then(res => {
			console.log(res, 'res');
		});
	},
};
</script>

<style lang="scss" scoped>
.home {
	height: 100%;
	text-align: center;
}
</style>
